﻿<StackPanel xmlns="http://schemas.microsoft.com/client/2007"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Height="250" Width="350" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
    <StackPanel.Resources>
        <ControlTemplate x:Key="ButtonControlTemplate2" TargetType="Button">
            <Grid>
                <vsm:VisualStateManager.VisualStateGroups>
                    <vsm:VisualStateGroup x:Name="FocusStates">
                        <vsm:VisualState x:Name="Unfocused"/>
                        <vsm:VisualState x:Name="Focused"/>
                    </vsm:VisualStateGroup>
                    <vsm:VisualStateGroup x:Name="CommonStates">
                        <vsm:VisualState x:Name="MouseOver"/>
                        <vsm:VisualState x:Name="Normal"/>
                        <vsm:VisualState x:Name="Pressed"/>
                        <vsm:VisualState x:Name="Disabled"/>
                    </vsm:VisualStateGroup>
                </vsm:VisualStateManager.VisualStateGroups>
                <Button Content="Button 2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontSize="20" FontStyle="Italic" FontFamily="Portable User Interface" FontWeight="Bold"/>
            </Grid>
        </ControlTemplate>
    </StackPanel.Resources>
    <Button x:Name="button1" Content="button1">
        <Button.Resources>
            <ControlTemplate x:Key="ButtonControlTemplate1" TargetType="Button">
                <Grid>
                    <vsm:VisualStateManager.VisualStateGroups>
                        <vsm:VisualStateGroup x:Name="FocusStates">
                            <vsm:VisualState x:Name="Unfocused"/>
                            <vsm:VisualState x:Name="Focused"/>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="CommonStates">
                            <vsm:VisualState x:Name="MouseOver"/>
                            <vsm:VisualState x:Name="Normal"/>
                            <vsm:VisualState x:Name="Pressed"/>
                            <vsm:VisualState x:Name="Disabled"/>
                        </vsm:VisualStateGroup>
                    </vsm:VisualStateManager.VisualStateGroups>
                    <Button Content="Button 1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontSize="20"/>
                </Grid>
            </ControlTemplate>
        </Button.Resources>
        <Button.Template>
            <StaticResource ResourceKey="ButtonControlTemplate1"/>
        </Button.Template>
    </Button>
    <Button x:Name="button2" Content="button2" Template="{StaticResource ButtonControlTemplate2}"/>
    <Button x:Name="button3" Content="button3" Template="{StaticResource BuckeyTemplate}"/>
</StackPanel>